<?php
class Tourism_freight_price_list_model extends CI_Model
{

    private $table    = 'tourism_freight_price_list';
    
     /**
     * 算出运费的价格
     * @param unknown $params
     */
    public function getFreightRow($params)
    {
        $this->db->select('first_unit,first_price,add_unit,add_price');
        $this->db->from($this->table);
        $area = trim(addslashes($params['area']));
        $sql = 'tid = ' . $params['id'] . ' AND (is_default = 1 OR area like "%' . $area . '%")';
        $this->db->where($sql);
        $this->db->order_by('is_default', 'asc');
        return $this->db->get()->row();
    }
}